package org.frame.auth.feign;

import java.util.Set;

import org.frame.auth.feign.fallback.RemoteUserServiceCallBack;
import org.frame.common.core.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(value = "frame-security", fallback = RemoteUserServiceCallBack.class)
public interface RemoteUserService {

	@RequestMapping(value = "/api/user/info/{userName}", method = RequestMethod.GET)
	public User userInfo(@PathVariable(value = "userName") String userName);

	@RequestMapping(value = "/api/user/perms/{userId}", method = RequestMethod.GET)
	public Set<String> userPerms(@PathVariable(value = "userId") Long userId);
	
}
